<!DOCTYPE HTML>
<html lang="zh-CN">

<head><meta name="generator" content="Hexo 3.9.0">
    <!--Setting-->
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <meta http-equiv="Cache-Control" content="no-transform">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta name="apple-mobile-web-app-capable" content="ydong博客">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no,email=no,adress=no">
    <meta name="browsermode" content="application">
    <meta name="screen-orientation" content="portrait">
    <meta name="theme-version" content="1.2.3">
    <meta name="root" content="/blog/">
    <link rel="dns-prefetch" href="http://ydongabc.gitee.io/blog">
    <!--SEO-->

<meta name="keywords" content="博客搭建,hexo">


<meta name="description" content="Hexo 是一个快速、简洁且高效的博客框架。Hexo 使用 Markdown（或其他渲染引擎）解析文章，在几秒内，即可利用靓丽的主题生成静态网页。
博客搭建1.环境准备：安装node.js和gi...">


<meta name="robots" content="all">
<meta name="google" content="all">
<meta name="googlebot" content="all">
<meta name="verify" content="all">
    <!--Title-->

<title>
    
    Hexo博客框架的搭建与使用 |
    
    ydong博客
</title>

<link rel="alternate" href="/atom.xml" title="ydong博客" type="application/atom+xml">


<link rel="icon" href="./favicon.ico">

    

<link rel="stylesheet" href="/blog/css/bootstrap.min.css?rev=3.3.7">
<link rel="stylesheet" href="/blog/css/font-awesome.min.css?rev=4.7.0">
<link rel="stylesheet" href="/blog/css/style.css?rev=@@hash">
    
<div class="hide">
    <script type="text/javascript">
    var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");
    document.write(unescape("%3Cspan class='cnzz_stat_icon_1263868967 hide' %3E%3Cscript%20src%3D%22https%3A%2F%2Fs95.cnzz.com%2Fz_stat.php%3Fweb_id%3D1272564536%22%3E%3C%2Fscript%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s19.cnzz.com/z_stat.php%3Fid%3D1263868967%26show%3Dpic1' type='text/javascript'%3E%3C/script%3E"));
    </script>
</div>




    

</head></html>
<!--[if lte IE 8]>
<style>
    html{ font-size: 1em }
</style>
<![endif]-->
<!--[if lte IE 9]>
<div style="ie">你使用的浏览器版本过低，为了你更好的阅读体验，请更新浏览器的版本或者使用其他现代浏览器，比如Chrome、Firefox、Safari等。</div>
<![endif]-->
<body>
    <header class="main-header"  style="background-image:url(
    /blog/./img/banner.jpg)"
     >
    <div class="main-header-box">
        <a class="header-avatar" href="/" title='John Doe'>
            <img src="/blog/img/avatar.jpg" alt="logo头像" class="img-responsive center-block">
        </a>
        <div class="branding">
            <!--<h2 class="text-hide">Snippet主题,从未如此简单有趣</h2>-->
            
            <img src="/blog/img/branding.png" alt="Snippet 博客主题" class="img-responsive center-block">
            
        </div>
    </div>
</header>
    <nav class="main-navigation">
    <div class="container">
        <div class="row">
            <div class="col-sm-12">
                <div class="navbar-header"><span class="nav-toggle-button collapsed pull-right" data-toggle="collapse" data-target="#main-menu" id="mnav">
                        <span class="sr-only"></span>
                        <i class="fa fa-bars"></i>
                    </span>
                    <a class="navbar-brand" href="http://ydongabc.gitee.io/blog">
                        ydong博客</a>
                </div>
                <div class="collapse navbar-collapse" id="main-menu">
                    <ul class="menu">
                        
                        <li role="presentation" class="text-center">
                            <a href="/blog"><i class="fa "></i>
                                首页</a>
                        </li>
                        
                        <li role="presentation" class="text-center">
                            <a href="/blog/categories/前端/"><i class="fa "></i>
                                前端</a>
                        </li>
                        
                        <li role="presentation" class="text-center">
                            <a href="/blog/categories/后端/"><i class="fa "></i>
                                后端</a>
                        </li>
                        
                        <li role="presentation" class="text-center">
                            <a href="/blog/categories/工具/"><i class="fa "></i>
                                工具</a>
                        </li>
                        
                        <li role="presentation" class="text-center">
                            <a href="/blog/archives/"><i class="fa "></i>
                                时间轴</a>
                        </li>
                        
                    </ul>
                </div>
            </div>
        </div>
    </div>
</nav>
    <section class="content-wrap">
        <div class="container">
            <div class="row">
                <main class="col-md-8 main-content m-post">
                    <p id="process"></p>
<article class="post">
    <div class="post-head">
        <h1 id="Hexo博客框架的搭建与使用">
            
            Hexo博客框架的搭建与使用
            
        </h1>
        <div class="post-meta">
    
    <span class="categories-meta fa-wrap">
        <i class="fa fa-folder-open-o"></i>
        <a class="category-link" href="/blog/categories/hexo博客框架/">hexo博客框架</a>
    </span>
    
    
    <span class="fa-wrap">
        <i class="fa fa-tags"></i>
        <span class="tags-meta">
            
            <a class="tag-link" href="/blog/tags/hexo/">hexo</a> <a class="tag-link" href="/blog/tags/博客搭建/">博客搭建</a>
            
        </span>
    </span>
    
    
    
    <span class="fa-wrap">
        <i class="fa fa-clock-o"></i>
        <span class="date-meta">
            2019/09/05</span>
    </span>
    
    
</div>
        
        
    </div>
    
    <div class="post-body post-content">
        <p><a href="https://hexo.io/" target="_blank" rel="noopener">Hexo</a> 是一个快速、简洁且高效的博客框架。<a href="https://hexo.io/" target="_blank" rel="noopener">Hexo</a> 使用 Markdown（或其他渲染引擎）解析文章，在几秒内，即可利用靓丽的主题生成静态网页<a id="more"></a>。</p>
<h2 id="博客搭建"><a href="#博客搭建" class="headerlink" title="博客搭建"></a><strong>博客搭建</strong></h2><h3 id="1-环境准备："><a href="#1-环境准备：" class="headerlink" title="1.环境准备："></a>1.环境准备：</h3><pre><code>安装node.js和git</code></pre><h3 id="2-安装hexo框架："><a href="#2-安装hexo框架：" class="headerlink" title="2.安装hexo框架："></a>2.安装hexo框架：</h3><pre><code>$ npm i hexo-cli -g</code></pre><h3 id="3-项目初始化："><a href="#3-项目初始化：" class="headerlink" title="3.项目初始化："></a>3.项目初始化：</h3><pre><code>$ hexo init</code></pre><h3 id="4-本地端口浏览：（hexo-s）"><a href="#4-本地端口浏览：（hexo-s）" class="headerlink" title="4.本地端口浏览：（hexo s）"></a>4.本地端口浏览：（hexo s）</h3><pre><code>$ hexo server</code></pre><h3 id="5-生成静态文件：（hexo-g）"><a href="#5-生成静态文件：（hexo-g）" class="headerlink" title="5.生成静态文件：（hexo g）"></a>5.生成静态文件：（hexo g）</h3><pre><code>$ hexo generate</code></pre><h3 id="6-安装部署插件："><a href="#6-安装部署插件：" class="headerlink" title="6.安装部署插件："></a>6.安装部署插件：</h3><pre><code>$ npm i hexo-deployer-git -s</code></pre><h3 id="7-配置根目录-config-jml文件："><a href="#7-配置根目录-config-jml文件：" class="headerlink" title="7.配置根目录_config.jml文件："></a>7.配置根目录_config.jml文件：</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">deploy: </span><br><span class="line">  type: git</span><br><span class="line">  repo: 仓库地址</span><br></pre></td></tr></table></figure>

<h3 id="8-网站语言设置为中文："><a href="#8-网站语言设置为中文：" class="headerlink" title="8.网站语言设置为中文："></a>8.网站语言设置为中文：</h3><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">language: zh-CN</span><br></pre></td></tr></table></figure>

<h3 id="9-推送部署：（hexo-d）"><a href="#9-推送部署：（hexo-d）" class="headerlink" title="9.推送部署：（hexo d）"></a>9.推送部署：（hexo d）</h3><pre><code>$ hexo deploy</code></pre><h3 id="10-开启仓库page服务"><a href="#10-开启仓库page服务" class="headerlink" title="10.开启仓库page服务"></a>10.开启仓库page服务</h3><p>注：如果没有样式，需修改_config.yml文件找到 url 和 root 进行配置</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">url: http:<span class="comment">//博客地址 </span></span><br><span class="line">root: <span class="regexp">/博客项目名</span></span><br></pre></td></tr></table></figure>

<h2 id="主题更换"><a href="#主题更换" class="headerlink" title="主题更换"></a><strong>主题更换</strong></h2><p>1.下载主题项目文件夹，将主题文件夹放到 blog/themes 目录下<br>2.配置根目录_config.jml文件：</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">#Extensions</span><br><span class="line">theme: 主题名称  <span class="comment">//即主题项目文件夹的名称</span></span><br></pre></td></tr></table></figure>

<p>3.重新生成资源文件并推送：<code>$ hexo g -d</code></p>
<h2 id="博文发布"><a href="#博文发布" class="headerlink" title="博文发布"></a><strong>博文发布</strong></h2><p>hexo n 文件名：<em>新建文章</em><br>hexo clean：<em>清空资源文件</em><br>hexo g：<em>重新生成资源文件</em><br>hexo d：<em>发布文章到仓库.io</em><br>(最后两步可简写为：hexo g -d)</p>

    </div>
    
    <div class="post-footer">
        <div>
            
            转载声明：
            商业转载请联系作者获得授权,非商业转载请注明出处 © <a href="" target="_blank">Snippet</a>
            
            
        </div>
        <div>
            
        </div>
    </div>
</article>
<div class="article-nav prev-next-wrap clearfix">
    
    <a href="/blog/2019/09/06/web worker后台运行js代码/" class="pre-post btn btn-default" title='Web Worker后台运行js代码'>
        <i class="fa fa-angle-left fa-fw"></i><span class="hidden-lg">上一篇</span>
        <span class="hidden-xs">
            Web Worker后台运行js代码</span>
    </a>
    
    
</div>

                </main>
                
                    <aside id="article-toc" role="navigation" class="col-md-4">
    <div class="widget">
        <h3 class="title">
            文章目录
        </h3>
        
        <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#博客搭建"><span class="toc-text">博客搭建</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-环境准备："><span class="toc-text">1.环境准备：</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-安装hexo框架："><span class="toc-text">2.安装hexo框架：</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#3-项目初始化："><span class="toc-text">3.项目初始化：</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#4-本地端口浏览：（hexo-s）"><span class="toc-text">4.本地端口浏览：（hexo s）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#5-生成静态文件：（hexo-g）"><span class="toc-text">5.生成静态文件：（hexo g）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#6-安装部署插件："><span class="toc-text">6.安装部署插件：</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#7-配置根目录-config-jml文件："><span class="toc-text">7.配置根目录_config.jml文件：</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#8-网站语言设置为中文："><span class="toc-text">8.网站语言设置为中文：</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#9-推送部署：（hexo-d）"><span class="toc-text">9.推送部署：（hexo d）</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#10-开启仓库page服务"><span class="toc-text">10.开启仓库page服务</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#主题更换"><span class="toc-text">主题更换</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#博文发布"><span class="toc-text">博文发布</span></a></li></ol>
        
    </div>
</aside>
                
            </div>
        </div>
    </section>
    <footer class="main-footer">
    <div class="container">
        <div class="row">
        </div>
    </div>
</footer>
<a id="back-to-top" class="icon-btn hide">
    <i class="fa fa-chevron-up"></i>
</a>
    <div class="copyright">
    <div class="container">
        <div class="row">
            <div class="col-sm-12">
                <div class="busuanzi">
    
</div>
            </div>
            <div class="col-sm-12">
                <span>Copyright &copy;
                    2017
                </span> |
                <span>
                    Powered by <a href="//hexo.io" class="copyright-links" target="_blank" rel="nofollow">Hexo</a>
                </span> |
                <span>
                    Theme by <a href="//github.com/shenliyang/hexo-theme-snippet.git" class="copyright-links" target="_blank" rel="nofollow">Snippet</a>
                </span>
            </div>
        </div>
    </div>
</div>



<script src="/blog/js/app.js?rev=@@hash"></script>
</body>
</html>